package com.wyp168.jvm001;

/**
 * @ClassName AnimalTest
 * @Description TODO
 * @Author wyp168
 * @Date 2022/8/5 09:53
 */
public abstract class AnimalTest001 {
    public void eat() {
        System.out.println("动物吃食物");
    }

    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.eat();
    }

    public abstract void hurt();
}
class Dog extends AnimalTest001 {
    @Override
    public void eat() {
        System.out.println("狗啃🦴");
    }

    @Override
    public void hurt() {
        System.out.println("狗拿耗子，多管闲事");
    }
}

class Cat extends AnimalTest001 {
    @Override
    public void eat() {
        System.out.println("猫吃🐟");
    }

    @Override
    public void hurt() {
        System.out.println("猫捉老鼠，天经地义");
    }
}
